<div class="container">
    <div class="row">
        <% arts.forEach(function(item, key){ %>
        <% if(item.imgs.length == 0){ %>
        <section class="col-md-3 col-sm-6 wow fadeIn">
            <div class="post relative">
                <div class="caption">

                    <div class="relative">
                        <div class="post-thumb relative">
                            <img src="/images/matt-berninger.jpg" class="img-responsive">
                        </div>

                        <div class="post-user relative">
                            <span class="post-tag">作者: <%= item.author %></span>
                            <a href="/article/view?id=<%= item._id %>" class="post-titles"><%= item.name %></a>
                        </div>
                    </div>

                    <div class="post-article relative">
                        <p class="post-description"><%- item.content.substr(0, 150) %>...</p>
                    </div>
                </div>

            </div>
        </section>
        <% }else{ %>

        <section class="col-md-3 col-sm-6 wow fadeIn">
            <div class="post relative">
                <div class="media relative">
                    <div id="slides-<%= key+1 %>" class="owl-theme">
                        <% item.imgs.forEach(function(img, k){ %>
                        <a href="/article/view?id=<%= item._id %>"><img src="<%= img %>" class="img-responsive"
                                                                        style="max-height: 200px;width:100%"></a>
                        <% }) %>
                    </div>
                    <div class="overlay">
                        <div class="iconl">
                            <i class="fa fa-heart-o"></i>
                        </div>
                    </div>
                </div>
                <div class="caption text-center">
                    <a href="/article/view?id=<%= item._id %>" class="post-title"
                       style="height: 32px;overflow: hidden;display: block"><%= item.name %></a>
                    <span class="post-date"><%- moment(item.createtime).locale('zh-cn').fromNow() %> </span>

                    <p class="post-description"><%- item.content.substr(0, 18) %>...</p>

                </div>


            </div>
        </section>
        <% } %>

        <% }) %>

    </div>
</div>